package Q3;

import java.util.Scanner;

public class Main {

    public static int n;
    public static int[] arr;
    public static boolean ret;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        n = scanner.nextInt();
        arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        dfs(0, new boolean[n]);

        System.out.println(ret);
    }

    public static void dfs(int index, boolean[] flag) {

        if (ret) {
            return;
        }

        if (index == n) {
            int sum1 = 0, sum2 = 0;
            for (int i = 0; i < n; i++) {
                if (flag[i]) {
                    sum1 += arr[i];
                } else {
                    sum2 += arr[i];
                }
            }

            if (sum1 == sum2) {
                ret = true;
            }

            return;
        }

        for (int i = index; i < n; i++) {
            //选
            flag[i] = true;
            dfs(i + 1, flag);
            //回溯
            flag[i] = false;

            //不选
            dfs(i + 1, flag);
        }
    }
}
